﻿using ServiceCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace Entity
{


    public class question_body_searchshow : question_body
    {

        public string question_state_str
        {
            get
            {
                return question_state.ToString();
            }
        }
    }
    /// <summary>
    /// 题库表
    /// </summary>
    public class question_body
    {
        /// <summary>
        /// 题ID
        /// </summary>
        public string question_id { get; set; }
        /// <summary>
        /// 题目内容
        /// </summary>
        public string question_content { get; set; }
        /// <summary>
        /// 题目类型
        /// </summary>
        public question_type? question_type { get; set; }
        /// <summary>
        /// 选项数量
        /// </summary>
        public int? option_length { get; set; }
        /// <summary>
        /// 题状态
        /// </summary>
        public question_state? question_state { get; set; }
        /// <summary>
        /// 所属商户
        /// </summary>
        public string baseuserid { get; set; }
        /// <summary>
        /// 答案
        /// </summary>
        public string answer_value { get; set; }
        /// <summary>
        /// 添加时间
        /// </summary>
        public DateTime addtime { get; set; } = DateTime.Now;
    }
    /// <summary>
    /// 题目选项
    /// </summary>
    public class question_option
    {
        /// <summary>
        /// 选项ID
        /// </summary>
        public string question_option_id { get; set; }
        /// <summary>
        /// 对应题目
        /// </summary>
        public string question_id { get; set; }
        /// <summary>
        /// 所属商户
        /// </summary>
        public string baseuserid { get; set; }
        /// <summary>
        /// 选项描述
        /// </summary
        public string option_content { get; set; }
        /// <summary>
        /// 排序字段  1A 2B 3C 以此类推
        /// </summary>
        public int? sort { get; set; }
        /// <summary>
        /// 添加时间 
        /// </summary>
        public DateTime addtime { get; set; } = DateTime.Now;
        /// <summary>
        /// 是否正确答案
        /// </summary>
        public bool? is_true { get; set; }
    }

    public enum question_state
    {
        启用 = 1,
        禁用 = 2
    }
    public enum question_type
    {
        单选 = 0,
        多选 = 1
    }

    public class save_question
    {
        /// <summary>
        /// 题干
        /// </summary>
        public question_body body { get; set; }

        public List<question_option> option { get; set; }
    }
     

    public class get_question_query : Base_List_Params
    {
        /// <summary>
        /// 题目内容查询
        /// </summary>
        public string content { get; set; }
        /// <summary>
        /// 题目类型
        /// </summary>
        public question_type? question_type { get; set; }

    }
    /// <summary>
    /// 返回给安卓的题目DTO
    /// </summary>
    public class return_question_item
    {
        public return_question_item() {
            options = new List<return_question_option>();
        }

        public int question_index { get; set; }
        /// <summary>
        /// 题ID
        /// </summary>
        public string question_id { get; set; }
        /// <summary>
        /// 题目内容
        /// </summary>
        public string question_content { get; set; }
        /// <summary>
        /// 题目类型
        /// </summary>
        public question_type question_type { get; set; }
        /// <summary>
        /// 题目类型 文字描述
        /// </summary>
        public string question_type_str { get { return question_type.ToString(); } }

        public IEnumerable<return_question_option> options { get; set; }
    }
    public class return_question_option
    {
        /// <summary>
        /// 选项描述
        /// </summary
        public string option_content { get; set; }
        /// <summary>
        /// 排序字段  1A 2B 3C 以此类推
        /// </summary>
        public int sort { get; set; }
    }
}
